package com.hanma.service.impl;

import com.hanma.bean.Manager;
import com.hanma.dao.ManagerDao;
import com.hanma.dao.impl.ManagerDaoImpl;
import com.hanma.service.ManagerService;

import java.util.Collections;
import java.util.List;

public class ManagerServiceImpl implements ManagerService {

    @Override
    public Manager findByNameAndPassword(String username, String password) {
        ManagerDao dao = new ManagerDaoImpl();
        return dao.findByNameAndPassword(username, password);
    }

    @Override
    public boolean insert(Manager manager) {
        ManagerDao dao = new ManagerDaoImpl();
        return dao.insert(manager)>0;
    }

    @Override
    public List<Manager> findAll(Integer id) {
        ManagerDao dao = new ManagerDaoImpl();
        return dao.findAll(id);
    }

    @Override
    public Manager findAllById(Integer id) {
        ManagerDao dao = new ManagerDaoImpl();
        return dao.findAllById(id);
    }
}
